//
//  RegViewController.swift
//  LazyCloset
//
//  Created by Wu YiYun on 14-11-6.
//  Copyright (c) 2014年 Wu YiYun. All rights reserved.
//

import UIKit

class RegTabBarController: UIViewController, UITabBarDelegate{
    
    var imageView:UIImageView!
    @IBOutlet weak var tabBar: UITabBar!
    @IBOutlet weak var reg: UITabBarItem!
    @IBOutlet weak var login: UITabBarItem!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        //self.view.addSubview(UIImageView(image: UIImage(named: fileName!))
        //scrollview = [UIScrollView alloc] initWithFrame:CGRectMake(0, 0, width, hight)];
        var width = self.view.bounds.size.width
        var height = self.view.bounds.size.height
        imageView = UIImageView(frame: CGRect(x: 0, y: 20, width: width, height: height - 70))
        imageView.image = UIImage(named: "1.jpg")
        self.view.addSubview(imageView)
        //imageView.hidden = true
    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    func tabBar(tabBar: UITabBar, didSelectItem item: UITabBarItem!) {
        if tabBar.selectedItem == login {
            performSegueWithIdentifier("Login", sender: AnyObject?())
        }
        else {
            performSegueWithIdentifier("Reg", sender: AnyObject?())
        }
    }
    
    
}
